{% include layout/header.html %}

<div class="content-container">

  <aside class="sidebar">
  	<a href="#" data-proofer-ignore class="toc-toggler">内容表格</a>
  	<div class="sidebar-wrapper">

      {% assign parent = page.breadcrumbs[0] %}
      {% assign steps = site.pages | where: "guide_version", page.guide_version | where: "level3_subgroup", page.level3_subgroup | sort: "menu_order" %}
      {% assign first_step = steps[0] %}
      <ul>
        <li class="level-0">
          <a href="{{ page.baseurl }}/{{ parent.url }}">
            <div class="back-link-subtitle">&larr; 返回到</div>
            <div class="back-link-title">{{ parent.title }}</div>
          </a>
        </li>
      {% for step in steps %}
        <li class="level1{% if step.url == page.url %}{% assign index = forloop.index %}  active{% endif %}">
          <a href="{{ site.baseurl }}{{ step.url }}">{% if step.menu_title %}{{ step.menu_title }}{% else %}{{step.title}}{% endif %}</a>
        </li>
      {% endfor %}
      </ul>

    </div>
  </aside>
  <!-- /.sidebar -->

	<section class="content">
		<div class="content-wrap">
			{% include layout/page-header.html %}
			{{ content }}

      <div class="horisontal-nav">
        {% assign steps_size = steps | size %}
        {% if index == 1 %}
          <a href="{{ site.baseurl }}{{ steps[index].url }}" class="btn btn-large btn-primary">Begin Tutorial</a>
        {% else %}
          {% assign next_i = index %}
          {% assign prev_i = index | minus: 2 %}

          <a href="{{ site.baseurl }}{{ steps[prev_i].url }}" class="btn btn-large btn-secondary">Previous</a>
          {% if index != steps_size %}
          <a href="{{ site.baseurl }}{{ steps[next_i].url }}" class="btn btn-large btn-primary">Next</a>
          {% endif %}

        {% endif %}
      </div>
      <!-- /.horisontal-nav -->

		</div>
		<!-- /.content-wrap -->

		{% include layout/page-info.html %}

	</section>
	<!-- /.content -->

</div> <!-- /.content-container -->

{% include layout/footer.html %}
